package com.yunban.project.api.text_check.controller;

import com.yunban.project.api.text_check.dto.ContentPolishReq;
import com.yunban.project.api.text_check.service.ContentPolishService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import net.lab1024.sa.base.common.annoation.NoNeedLogin;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * @author: lijiajun
 * @date: 2025-02-18
 * @version: 1.0
 */
@RestController
@Tag(name = "文本润色")
@RequestMapping("/content-polish-api")
public class ContentPolishController {

    @Resource
    private ContentPolishService contentPolishService;

    @NoNeedLogin
    @Operation(summary = "文本润色")
    @PostMapping(value = "/polish", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public SseEmitter polish(@RequestBody @Validated ContentPolishReq req) {
        return this.contentPolishService.polish(req);
    }
}
